package com.study.reflect.example2;

import java.lang.reflect.Proxy;

/**
 * @Author HBZ
 * @Date 2020/7/29 23:39
 * @Description
 */
public class MyProxyFactory {
    public static Object getProxy(Object target) {
        MyInvocationHandler handler=new MyInvocationHandler();
        handler.setTarget(target);
        return Proxy.newProxyInstance(target.getClass().getClassLoader(),target.getClass().getInterfaces(),handler);
    }
}
